<template>
	<view>
		<view class="nav2">
			<u-navbar title="同名人数列表" bgColor="transparent" :fixed="false" autoBack>
			</u-navbar>
		</view>
		<u-gap height="20"></u-gap>
		<view class="ml30 mr30 form-box pore">
			<view class="bgFff p30 radius30 flex-jus">
				<text class="f28 c343">{{parameter.name}}</text>
				<view class="flex">
					<text class="f28 c343">东楚区同名</text>
					<text class="f60 bold c343 ml20">{{count}}</text>
				</view>
			</view>
			<u-gap height="20"></u-gap>
			<view class="ml20 mr20">
				<view class="flex-jus item f26 c343" v-for="(item,index) in listData" :key="index">
					<text class="flex1">性别:{{item.sex == 1?'男':'女'}}</text>
					<text class="flex1">年龄:{{item.ages}}岁</text>
					<text class="flex2">出生日期:{{item.date}}</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {checkDuplicateName} from '@/common/api_car.js'
	export default {
		name: '',
		data() {
			return {
				parameter:{},
				count:0,
				listData:[]
			}
		},
		onLoad(option) {
			this.parameter = option
			this.checkDuplicateName()
		},
		methods: {
			async checkDuplicateName() {
				let data = {
					...this.parameter,
					type:'list'
				}
				uni.showLoading({
					mask: true
				})
				const res = await checkDuplicateName(data)
				uni.hideLoading()
				if (res.code == 200) {
					const { total, list } = res.data
					this.count = total
					this.listData = list
				}
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #FEF4E8;
	}
	.item{
		padding: 20rpx 0;
		border-bottom: 1px solid #eee;
	}
</style>